package com.bruce.hmily_provider_user.feign;

import org.dromara.hmily.annotation.Hmily;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 类注释
 *
 * @author Bruce
 * @date 2021/3/22 3:52 PM
 */
@FeignClient(value = "hmily-provider-usercoupon", fallback = FeignUserCouponFall.class)
public interface FeignUserCoupon {
    /**
     * 此处要加@Hmily注解，把主事务注入到子事务方法中，否则无法执行子事务的confirm方法
     * @param userId
     * @param userCouponId
     * @param couponMoney
     * @return
     */
    @Hmily
    @GetMapping("/usercoupon/update")
    Object update(@RequestParam("userId") long userId, @RequestParam("userCouponId") long userCouponId, @RequestParam("couponMoney") double couponMoney);
}
